﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OPMS_V1
{
    public partial class TBDHome : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            imgfeedback.Attributes.Add("onclick", "callpopup()");
            try
            {
                string mode = Convert.ToString(Session["statusPage"]);

                switch (mode)
                {
                    case "buy":
                        {
                            btnBuy.BackColor = System.Drawing.Color.IndianRed;
                            btnBuy.BorderColor = System.Drawing.Color.IndianRed;
                            lblBuyLine.BackColor = System.Drawing.Color.IndianRed;
                            break;
                        }
                    case "rent":
                        {
                            btnRent.BackColor = System.Drawing.Color.Purple;
                            btnRent.BorderColor = System.Drawing.Color.Purple;
                            lblBuyLine.BackColor = System.Drawing.Color.Purple;
                            break;
                        }
                    case "share":
                        {
                            btnShare.BackColor = System.Drawing.Color.SkyBlue;
                            btnShare.BorderColor = System.Drawing.Color.SkyBlue;
                            lblBuyLine.BackColor = System.Drawing.Color.SkyBlue;
                            break;
                        }
                    case "Ad":
                        {
                            btnPlaceProperty.BackColor = System.Drawing.Color.Gold;
                            btnPlaceProperty.BorderColor = System.Drawing.Color.Gold;
                            lblBuyLine.BackColor = System.Drawing.Color.Gold;
                            break;
                        }
                }
            }
            catch (Exception)
            {

            }
        }
        protected void btnHome_Click(object sender, EventArgs e)
        {
            Response.Redirect("~\\Index.aspx");
        }

        protected void btnBuy_Click(object sender, EventArgs e)
        {
            Session["statusPage"] = "buy";
            Response.Redirect("~\\Property.aspx?Mode=buy");
        }

        protected void btnShare_Click(object sender, EventArgs e)
        {
            Session["statusPage"] = "share";
            Response.Redirect("~\\Property.aspx?Mode=share");
        }

        protected void btnRent_Click(object sender, EventArgs e)
        {
            Session["statusPage"] = "rent";
            Response.Redirect("~\\Property.aspx?Mode=rent");
        }

        protected void btnFindAgent_Click(object sender, EventArgs e)
        {

        }

        protected void btnPlaceProperty_Click(object sender, EventArgs e)
        {
            Session["statusPage"] = "Ad";
            Response.Redirect("~/Public/SelfService.aspx?Mode=" + Session["statusPage"].ToString());
        }

        protected void imgfeedback_Load(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open( 'PackingSlipPrint.aspx', null, 'height=400,width=800,status=yes,toolbar=no,menubar=no,location=no' )", true);
        }            
    }
}
